﻿using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle;
using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle.VehicleConfig;
using JshRCSWebApi.Infrastructure.Domain.VO.SysVehicle.VehicleConfig;
using JshRCSWebApi.Service.SysVehicle;

namespace JshRCSWebApi.API.Controllers.SysVehicle
{
    public class VehicleConfigController : BaseController
    {
        private readonly VehicleConfigService _vehicleConfigService;
        public VehicleConfigController(IHttpContextAccessor httpContextAccessor, VehicleConfigService vehicleConfigService) : base(httpContextAccessor)
        {
            _vehicleConfigService = vehicleConfigService;
        }
        /// <summary>
        /// 上传地图到机器人 4010 
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_uploadmap_req(RequestDTO<robot_config_downloadmap_VO> requestDTO)
            => await _vehicleConfigService.robot_config_uploadmap_req(requestDTO);

        /// <summary>
        /// 抢占控制权 4005
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_lock_req(RequestDTO<robot_config_lock_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_lock_req(requestDTO);

        /// <summary>
        /// 释放控制权 4006
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_unlock_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_unlock_req(requestDTO);

        /// <summary>
        /// 清除货物形状 4356 
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clear_goodsshape_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clear_goodsshape_req(requestDTO);

        /// <summary>
        /// 设置货架描述文件 4357 
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_set_shelfshape_req(RequestDTO<robot_config_set_shelfshape_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_set_shelfshape_req(requestDTO);

        /// <summary>
        /// 移除动态障碍物 4352
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_removeobstacle_req(RequestDTO<robot_config_removeobstacle_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_removeobstacle_req(requestDTO);

        /// <summary>
        /// 删除机器人上的地图 4012 
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_removemap_req(RequestDTO<robot_config_removemap_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_removemap_req(requestDTO);

        /// <summary>
        /// 临时修改机器人参数 4100  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_setparams_req(RequestDTO<robot_config_setparams_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_setparams_req(requestDTO);

        /// <summary>
        /// 永久修改机器人参数 4101  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_saveparams_req(RequestDTO<robot_config_saveparams_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_saveparams_req(requestDTO);

        /// <summary>
        /// 恢复机器人参数为默认值 4102  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_reloadparams_req(RequestDTO<robot_config_reloadparams_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_reloadparams_req(requestDTO);

        /// <summary>
        /// 配置机器人推送端口 4091   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_push_req(RequestDTO<robot_config_push_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_push_req(requestDTO);

        /// <summary>
        /// 从机器人下载地图 4011    
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_downloadmap_req(RequestDTO<robot_config_downloadmap_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_downloadmap_req(requestDTO);

        /// <summary>
        /// 设置第三方 Warning 4802     
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_setwarning_req(RequestDTO<robot_config_setwarning_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_setwarning_req(requestDTO);

        /// <summary>
        /// 清除第三方 Warning 4803   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clearwarning_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clearwarning_req(requestDTO);

        /// <summary>
        /// 设置第三方 Error 4800      
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_seterror_req(RequestDTO<robot_config_seterror_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_seterror_req(requestDTO);

        /// <summary>
        /// 清除机器人当前所有报错 4009    
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clearallerrors_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clearallerrors_req(requestDTO);

        /// <summary>
        /// 运行信息复位 4450     
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clear_odo_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clear_odo_req(requestDTO);

        /// <summary>
        /// 清除货架描述文件 4356      
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clear_shelfshape_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clear_shelfshape_req(requestDTO);

        /// <summary>
        /// 清除第三方 Error 4801       
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_clearerror_req(RequestDTO requestDTO)
            => await _vehicleConfigService.robot_config_clearerror_req(requestDTO);

        /// <summary>
        /// 插入动态障碍物(机器人坐标系) 4350       
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_addobstacle_req(RequestDTO<robot_config_addobstacle_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_addobstacle_req(requestDTO);

        /// <summary>
        /// 插入动态障碍物(世界坐标系) 4351        
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_config_addgobstacle_req(RequestDTO<robot_config_addgobstacle_DTO> requestDTO)
            => await _vehicleConfigService.robot_config_addgobstacle_req(requestDTO); 
    }
    
}
